Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add base256emoji #88

Merged
merged 1 commit into from
Jun 8, 2022
Merged

Conversation

Jorropo
Copy link
Contributor

@Jorropo Jorropo commented Dec 4, 2021

I think this should be merged because :

  • It's fun and allows us have an almost endless of fun in docs and trolling opportunities.
  • Most of the NFT community likes useless differentiation features, why not giving what they want ?
  • It's a good test for unicode based encodings in current implementations.
  • It makes for a great education tool about what the spirit of multiformats is about (I found that some new people over sacralise what a CID is, if we allows dumb stuff like that I think it will be helpfull to explain to people that things are really extensible and you can make whatever you want on top of it).
  • It's not taking valuable prefix space (the 馃殌 preffix is very unlikely to ever be used by anything else).
  • Implementations that doesn't support unicode will just error with codec not found (since the first byte of 馃殌 is not valid ascii nor unicode it would be wrong from us to use as a prefix).

TL;DR:

I think it has a very slight positive impact and no negative impact, let's merge this. :)

@Stebalien
Copy link
Member

Hm. My first thought is that the readme needs some pithy examples.

Other than that 鉁旓笍.

@ribasushi
Copy link
Contributor

I love this! A note: you use 馃殌 both as "multibase prefix" and as "digit 0", perhaps disambiguating the two is worthwhile 馃し

@Jorropo
Copy link
Contributor Author

Jorropo commented Dec 9, 2021

@ribasushi

you use rocket both as "multibase prefix" and as "digit 0", perhaps disambiguating the two is worthwhile

I don't really get why that an issue, whats the rational behind this ?
I believe the only thing we was trying to do is:

  • we should attempt to use prefixes that doesn't encode in smaller / alternative bases (which I'm certain to have covered)
  • the prefix should be in the alphabet (which is)

Would swapping 馃殌 (0) and 馃獝 (5) in the table by enough of a fix ?

@ribasushi
Copy link
Contributor

No, I meant have 馃殌 mean exclusively "this string is a mojibase encoding" and use 256 other distinct emojis used for the encoding. So all in all you will have 257 defined "atoms". I do not have a solid rationale for this, just feels "cleaner", given you character set is virtually unconstrained.

@Jorropo
Copy link
Contributor Author

Jorropo commented Dec 9, 2021

I have two counter arguments :

  • I like rockets, the more rockets there is the happier I am. (It's not like it's taking the place of an other valuable emoji that could be represented, see the go impl code comments for emoji rational (btw if anyone has ideas for important emojies to include send it pls))
  • Other bases don't do that, most of them use their biggest glyph as prefix. (Here I'm doing the reverse so inlined blocks have at least two rockets (key + identity multihash) because cid inlining is very cool and because all of the collision with smaller base thing is not an issue this time).

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General emoji choice comments. I'd also consider trying to make emoji's as unique as possible.

(I mean, if we're going to paint the bikeshed, we might as well paint it well)

rfcs/Base256Emoji.md Outdated Show resolved Hide resolved
rfcs/Base256Emoji.md Outdated Show resolved Hide resolved
rfcs/Base256Emoji.md Outdated Show resolved Hide resolved
rfcs/Base256Emoji.md Outdated Show resolved Hide resolved
rfcs/Base256Emoji.md Outdated Show resolved Hide resolved
rfcs/Base256Emoji.md Outdated Show resolved Hide resolved
@Jorropo
Copy link
Contributor Author

Jorropo commented Dec 9, 2021

(I mean, if we're going to paint the bikeshed, we might as well paint it well)

The only real usecase I see is NFT artists bruteforcing cool emoji patern for their collection.

So I belive we need rockets and moons.
Then for the rest I've figurated that nft artists likely like the same emojies as the average peoples so I took a top list from unicode's popularity count.

But if anyone has thought thru propositions I'm for it.

@vmx
Copy link
Member

vmx commented Dec 10, 2021

I'm also in favour of using an emoji as prefix which is in the set of the 256 emojis

because cid inlining is very cool

It is not and I hope it's used less and less. It causes more trouble then good. The only use case I see is for data where the hash is bigger than the actual data. Though even then you're probably better off with other solutions, e.g. combining some of your data into bigger chunks.

@BigLep
Copy link

BigLep commented Jan 14, 2022

@Jorropo : are you able to incorporate the input here, particularly around not supported emojis?

@Jorropo
Copy link
Contributor Author

Jorropo commented Jan 14, 2022

@BigLep

are you able to incorporate the input here, particularly around not supported emojis?

Yes, at first I didn't really wanted to, but since it seems that everyone think emojies that work is an important thing yes.
It's just really unimportant and havn't attempted to give me time to work on this yet.

@Jorropo
Copy link
Contributor Author

Jorropo commented Jun 8, 2022

New fixed version pushed.

Pls could you merge with git merge (not rebase) so the commit hash wont change and go-multibase's submodule wont need yet an other push.

multibase.csv Outdated
base64url, u, rfc4648 no padding, default
base64urlpad, U, rfc4648 with padding, default
proquint, p, PRO-QUINT https://arxiv.org/html/0901.4016, draft
base256emoji, 馃殌, base256 with custom alphabet using variable-sized-codepoints, draft
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the most triggering thing about this is the fact that the emoji breaks the fixed-width table:
Screenshot 2022-06-08 at 3 18 56 pm

Copy link
Contributor Author

@Jorropo Jorropo Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know sorry (no I love that).

JuST GeT A PROper monO SPaCE FONt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I'm one space to short

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now actually monospace correct (if you had a monospace emoji it wouldn't break).

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, got an implementation for this yet?

@Jorropo
Copy link
Contributor Author

Jorropo commented Jun 8, 2022

yes multiformats/go-multibase#46
I'm just cleaning it up and also applying the requested changes, I'll push there soon

@Jorropo
Copy link
Contributor Author

Jorropo commented Jun 8, 2022

multiformats/go-multibase#46 is now ready for review too.

On my side it's RFM

rvagg added a commit to multiformats/js-multiformats that referenced this pull request Jun 8, 2022
rvagg added a commit to multiformats/js-multiformats that referenced this pull request Jun 8, 2022
rvagg added a commit to multiformats/js-multiformats that referenced this pull request Jun 8, 2022
rvagg added a commit to multiformats/js-multiformats that referenced this pull request Jun 8, 2022
rvagg added a commit to multiformats/js-multiformats that referenced this pull request Jun 8, 2022
@rvagg
Copy link
Member

rvagg commented Jun 8, 2022

Merge commits really grind my gears .. but since you insist and there's recent precedent in this repo I'll hold my nose

multiformats/js-multiformats#187 for JS impl

@rvagg rvagg merged commit cf05a93 into multiformats:master Jun 8, 2022
@Jorropo Jorropo deleted the base256emoji branch June 8, 2022 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants